package vip.ipav.spring.cloud.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.ipav.spring.cloud.service.MicroServiceHelloService;

/**
 * 测试控制器
 *
 *
 */
@RestController
public class HelloController {
    @Autowired
    private MicroServiceHelloService microServiceHelloService;

    @GetMapping("who")
    public String who() {
        return "I am MicroServiceB";
    }

    @GetMapping("who-a")
    public String whoa() {
        return microServiceHelloService.who();
    }

    @GetMapping("post-a")
    public String post(){
        return microServiceHelloService.post();
    }

    @GetMapping("hello-a")
    public String hello(){
        //FeignClient方式，参数必须传过去，未测试
        return microServiceHelloService.hello("micro-service-b","micro-service-a");
    }
}